package com.ailanyin.modules.job.domain;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.ailanyin.common.base.constants.ScheduleConstant;
import com.ailanyin.common.base.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 定时任务
 *
 * @author ailanyin
 * @version 1.0
 * @since 2021/10/15 0015 上午 10:00
 */
@Data
@EqualsAndHashCode(callSuper = false)
public class SysJob extends BaseEntity {

    private static final long serialVersionUID = 1L;

    private Long jobId;

    @Excel(name = "任务名称" , width = 20)
    private String jobName;

    @Excel(name = "任务分组" , width = 20)
    private String jobGroup;

    @Excel(name = "执行类方法" , width = 30)
    private String invokeTarget;

    /**
     * cron执行表达式
     */
    @Excel(name = "Cron表达式" , width = 20)
    private String cronExpression;

    /**
     * cron计划策略
     */
    @Excel(name = "计划策略" , width = 20, replace = {"默认执行_0" , "立即触发执行_1" , "触发一次执行_2" , "不触发立即执行_3"})
    private String misfirePolicy = ScheduleConstant.MISFIRE_DEFAULT;

    /**
     * 是否并发执行（0允许 1禁止）
     */
    @Excel(name = "并发执行" , replace = {"允许_0" , "禁止_1"})
    private String concurrent;

    /**
     * 任务状态（0正常 1暂停）
     */
    @Excel(name = "状态" , replace = {"正常_0" , "暂停_1"})
    private String status;

}
